home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / lib / partman / update.d / 50filesystems < prev    next >
Text File  |  2008-10-29  |  1KB  |  71 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/base.sh
  4.  
  5. dev=$1
  6. num=$2
  7. id=$3
  8. size=$4
  9. type=$5
  10. fs=$6
  11. path=$7
  12. name=$8
  13.  
  14. cd $dev
  15.  
  16. mkdir -p $id
  17.  
  18. if [ $fs = free ]; then
  19.     rm -f $id/method
  20. fi
  21.  
  22. if [ ! -f $id/method ] || [ ! -f $id/use_filesystem ]; then
  23.     rm -f $id/acting_filesystem
  24.     exit 0
  25. fi
  26.  
  27. if [ -f $id/filesystem ]; then
  28.     cp $id/filesystem $id/acting_filesystem
  29. else
  30.     rm -f $id/acting_filesystem
  31. fi
  32.  
  33. open_dialog PARTITION_INFO $id
  34. read_line num id size type fs path name
  35. close_dialog
  36.  
  37. acting_filesystem=''
  38. if [ -f $id/acting_filesystem ] && \
  39.    acting_filesystem=$(cat $id/acting_filesystem) && \
  40.    [ -f /lib/partman/parted_names/$acting_filesystem ] && \
  41.    new_fs=$(cat /lib/partman/parted_names/$acting_filesystem) && \
  42.    [ "$fs" != "$new_fs" ]; then
  43.     open_dialog CHANGE_FILE_SYSTEM $id $new_fs
  44.     close_dialog
  45. fi
  46.  
  47. existing=no
  48. formatable=no
  49.  
  50. for i in /lib/partman/valid_filesystems/*; do
  51.     [ -x $i ] || continue
  52.     if [ "$($i $dev $id existing)" = "$acting_filesystem" ]; then
  53.         existing=yes
  54.     fi
  55.     if [ "$($i $dev $id formatable)" = "$acting_filesystem" ]; then
  56.         formatable=yes
  57.     fi
  58. done
  59.  
  60. if [ $existing = yes ]; then
  61.     > $dev/$id/existing
  62. else
  63.     rm -f $dev/$id/existing
  64. fi
  65.  
  66. if [ $formatable = yes ]; then
  67.     > $dev/$id/formatable
  68. else
  69.     rm -f $dev/$id/formatable
  70. fi
  71.